package cn.gene.timeyan.security.sso.mapper.user;

import cn.gene.timeyan.pojo.ums.model.User;
import cn.gene.timeyan.pojo.ums.vo.UserVO;
import org.apache.ibatis.annotations.Param;
import org.springframework.beans.factory.annotation.Qualifier;
import org.springframework.stereotype.Repository;

/**
 * 用户*
 *
 * @author LWG
 * @date 2022/7/22 15:25
 * @since 1.0.0@gene.cn
 */
@Qualifier("db2SqlSessionTemplate")
@Repository
public interface UserMapper {

    /**
     * 通过用户名查询用户信息
     *
     * @param username
     * @return
     */
    User findByUsername(String username);

    /**
     * 通过用户id 查询用户信息
     *
     * @param id
     * @return
     */
    UserVO findById(Long id);

    User findByUsernameAndPassword(@Param("userName") String userName,@Param("password") String password);

    User findByEmail(@Param("resource") String resource);

    User findByPhone(@Param("resource") String resource);

    int updatePwd(@Param("username")String username, @Param("pwd")String pwd);

    String getPwdByUserName(@Param("username")String username);
}
